package com.chong.foundation;

public class Calculation01 {
    public static void main(String[] args) {
        // java运算

        // 1. 算术运算符
        //加法(+)
        int a = 10;
        int b = 20;
        int c = a + b;
        System.out.println(c); //30


        //减法(-)
        int d = 30;
        int e = 20;
        int f = d - e;
        System.out.print(f + "\n"); //10

        //乘法(*)
        int c1 = 10;
        int c2 = 20;
        int c3 = c1 * c2;
        System.out.print(c3 + "\n");//200


        //除法(/)
        int a1 = 10;
        int a2 = 5;
        int a3 = a1 / a2;
        System.out.print(a3 + "\n"); //2

        //取模(%)
        int b1 = 10;
        int b2 = 3;
        int b3 = b1 % b2;
        System.out.print(b3 + "\n"); //1

        //自增(++)
        int b4 = 5;
        //  System.out.print(b4++ + "\n");
        System.out.print(++b4 + "\n"); //6

        //自减(- -)
        int d1 = 1;
        //System.out.print(d1-- + "\n");
        System.out.print(--d1 + "\n");//0
    }
}
